﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TRPOP.Common;

namespace TRPOP.CMS.Model
{

    /// <summary>
    /// DropDownList Bind 的Info
    /// </summary>
    [Serializable]
    public class DDLBindInfo
    {

        #region  私有变量
        private string m_VarKey = string.Empty;
        private string m_VarName = string.Empty;
        private string m_VarValue = string.Empty;
        private string m_VarType = string.Empty;
        #endregion

        #region 成员函数
        /// <summary>
        /// VarKey 
        /// </summary>
        public string VarKey
        {
            get
            {
                return m_VarKey;
            }
            set
            {
                m_VarKey = value;
            }
        }


        /// <summary>
        /// VarName
        /// </summary>
        public string VarName
        {
            get
            {
                return m_VarName;
            }
            set
            {
                m_VarName = value;
            }
        }


        /// <summary>
        /// VarValue
        /// </summary>
        public string VarValue
        {
            get
            {
                return m_VarValue;
            }
            set
            {
                m_VarValue = value;
            }
        }


        /// <summary>
        /// VarType
        /// </summary>
        public string VarType
        {
            get
            {
                return m_VarType;
            }
            set
            {
                m_VarType = value;
            }
        }
        #endregion

        #region 构造器
        public DDLBindInfo()
        {

        }
        public DDLBindInfo(string oVarKey, string oVarName, string oVarValue, string oVarType)
        {
            m_VarKey = oVarKey;
            m_VarName = oVarName;
            m_VarValue = oVarValue;
            m_VarType = oVarType;
        }
        #endregion
    }

}

/*
    /// <summary>
    /// 用于绑定DropDownList 的帮助方法
    /// 内容分页
    /// </summary>
    public static class DDLBindInfoHelper
    {
        #region ContentPager 内容页分页
        static List<DDLBindInfo> mContentPagers;
        static string m_ContentPagersFileName = Common.Util.GetMapPath(SystemConst.ConfigRootName + SystemConst.SystemVar_ContentPagerFileName);
        public static List<DDLBindInfo> ContentPagers
        {
            get
            {
                if (mContentPagers != null)
                {
                    return mContentPagers;
                }
                else
                {
                    mContentPagers = new List<DDLBindInfo>();

                    if (FileUtil.IsExist(m_ContentPagersFileName))
                    {
                        mContentPagers = SerializationHelper.Load(typeof(List<DDLBindInfo>), m_ContentPagersFileName) as List<DDLBindInfo>;
                    }

                    if (mContentPagers == null || mContentPagers.Count <= 0)
                    {
                        mContentPagers = new List<DDLBindInfo>();

                        mContentPagers.Add(new DDLBindInfo()
                        {
                            VarKey = "default",
                            VarName = "default",
                            VarType = "default",
                            VarValue = "text"
                        });

                        SerializationHelper.Save(mContentPagers, m_ContentPagersFileName);
                    }

                    return mContentPagers;
                }
            }
        }
        #endregion

        #region ContentEditors 内容编辑器
        static List<DDLBindInfo> mContentEditors;
        static string m_ContentEditorsFileName = Common.Util.GetMapPath(SystemConst.ConfigRootName + SystemConst.SystemVar_ContentEditorFileName);
        public static List<DDLBindInfo> ContentEditors
        {
            get
            {
                if (mContentEditors != null)
                {
                    return mContentEditors;
                }
                else
                {
                    mContentEditors = new List<DDLBindInfo>();

                    if (FileUtil.IsExist(m_ContentEditorsFileName))
                    {
                        mContentEditors = SerializationHelper.Load(typeof(List<DDLBindInfo>), m_ContentEditorsFileName) as List<DDLBindInfo>;
                    }

                    if (mContentEditors == null || mContentEditors.Count <= 0)
                    {
                        mContentEditors = new List<DDLBindInfo>();

                        mContentEditors.Add(new DDLBindInfo()
                        {
                            VarKey = "default_editor",
                            VarName = "default_editor",
                            VarType = "text",
                            VarValue = "news_editor"
                        });
                        mContentEditors.Add(new DDLBindInfo()
                        {
                            VarKey = "html_editor",
                            VarName = "html_editor",
                            VarType = "text",
                            VarValue = "html_editor"
                        });
                        mContentEditors.Add(new DDLBindInfo()
                        {
                            VarKey = "xheditor",
                            VarName = "xheditor",
                            VarType = "text",
                            VarValue = "xheditor"
                        });

                        SerializationHelper.Save(mContentEditors, m_ContentEditorsFileName);
                    }

                    return mContentEditors;
                }
            }
        }
        #endregion
    }

    */
